/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.uoc.tdp.pac3.client.gui.model;

import edu.uoc.tdp.pac3.bo.IIncidenciaBO;
import edu.uoc.tdp.pac3.domain.Request;
import edu.uoc.tdp.pac3.domain.RequestNote;
import java.rmi.RemoteException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 * Implementacio de AbstractModel per l'acces a dades de RequestNote
 * @author Gerard
 */
public class RequestNoteModel extends AbstractModel<RequestNote> {
    
    private Request request;

    public RequestNoteModel(IIncidenciaBO bo) {
        
    }
    
    public RequestNoteModel(IIncidenciaBO bo, Request request) throws RemoteException{
        super(bo);
        this.request = request;
        fillList();
    }
    
    

    @Override
    protected void fillList() throws RemoteException {
        try {
            if(request != null){
                setItems(getBo().getRequestNoteFromRequest(request));
            }
        } catch (RemoteException ex) {
            Logger.getLogger(RequestNoteModel.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
    
   

}
